package netjava.db;

public class Createcon {
	public java.sql.Connection getconnection()
	{
		java.sql.Connection con=null;
		if(con==null)
		{
			try {
				Class.forName("com.mysql.jdbc.Driver");
				String url="jdbc:mysql://localhost:3306/myblog";
				con=java.sql.DriverManager.getConnection(url, "root", "netjava");
				return con;
			} catch (Exception e) {
				
				e.printStackTrace();
			}
		}
		return con;
	}
public static void main(String[] args)
{
	Createcon con=new Createcon();
	con.getconnection();
	
	}
}
